/*************************************************************************
	> File Name: Temperatureprotect.c
	> Author: 
	> Mail: 
	> Created Time: 2018/02/08 Fri 10:32
	> Version     :
 ************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

#include "AwinicLog.h"
#include "BaseAlgo.h"
#include "TemperatureProtect.h"




void temperatureProtectProcess(int32_t *data,tmpProtectCfg_t *cfg,uint16_t cnt)
{
	if(cfg->isEnable == 1)
	{
	    highFreqAGCProcess(data,&cfg->freqAGCCfg,cnt);
	}
}
int temperatureProtectInit(tmpProtectCfg_t *cfg)
{
	  highFreqAGCInit(&cfg->freqAGCCfg);
	  return 0;
}
int temperatureProtectReset(tmpProtectCfg_t *cfg)
{
	highFreqAGCReset(&cfg->freqAGCCfg);
	return 0;
}
int temperatureProtectSetParams(tmpProtectCfg_t *cfg,tmpProtParams_t *params,uint16_t dataBitNum)
{
	cfg->isEnable = params->isEnable;
	highFreqAGCSetParams(&cfg->freqAGCCfg,&params->freqAGCCParams,dataBitNum);
	return 0;
}
int temperatureProtectGetParams(tmpProtectCfg_t *cfg,tmpProtParams_t *params,uint16_t dataBitNum)
{
	params->isEnable = cfg->isEnable;
	highFreqAGCGetParams(&cfg->freqAGCCfg,&params->freqAGCCParams,dataBitNum);
	return 0;
}
